<!--
 * @FileDescription 视角导航
 * @Author lz
 * @Date 20230223 15:37:23
 * @LastEditors lz
 * @LastEditTime 20230223 15:37:23
-->
<template>
    <div class="perspective_wp" v-if="state.show">
        <div class="tit">视角导航</div>
        <img src="/colImages/DecorativeLine_r.png" class="line">
        <img src="/colImages/develop.png" class="develop" @click="show()">

        <div class="ContentBox">
            <div class="viewBox" v-for="(item, index) in HomeContent.Default.MenuList.value.ViewConfig">
                <img src="/colImages/cm_ico.png" class="viewBox_ico" @click="changing_over(item)"
                    v-if="item.Name == '车辆前视角' || item.Name == '车辆后视角'">
                <AimOutlined v-if="item.Name == '起始点'" class="viewBox_ico" @click="changing_over(item)" />
                <SlidersOutlined v-if="item.Name == '前急停开关' || item.Name == '后急停开关'" class="viewBox_ico" @click="changing_over(item)"  />
                <ClusterOutlined v-if="item.Name == '控制面板'" class="viewBox_ico" @click="changing_over(item)" />
                <AimOutlined v-if="item.Name == '车辆行驶视角'" class="viewBox_ico" @click="changing_over(item)" />
                <p>{{ item.Name }}</p>
            </div>
        </div>
    </div>
    <div class="StowedState" v-if="!state.show" @click="show()">
        <img src="/colImages/ExpandArrow_r.png" class="expArr">
    </div>
</template>

<script setup lang="ts">
import {
    AimOutlined,
    SlidersOutlined,
    ClusterOutlined,
} from '@ant-design/icons-vue';
import OrbitCameraComponent from '@components/Apps/InertialNavigation/OrbitCameraComponent';
import WebSocketComponent from '@runtime/module/WebSocket/WebSocketComponent';
import { reactive, ref, toRefs, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onUnmounted, StyleValue, defineProps, defineEmits } from 'vue'
import HomeContent from '../../HomeContent';
const state = reactive({
    show: true,
});
function show() {
    state.show = !state.show
}
async function changing_over(val: any) {
    console.log("valllllllllllllllllllllllllll",val);
    let newData = await OrbitCameraComponent.Default.UpdateV2Async(val.Path, val.Horizontal, val.Vertical, val.Distance, val.MinDistance, val.MaxDistance, val.HorizontalSpeed, val.VerticalSpeed, val.DistanceSpeed,val.Id);
    // let newData = await WebSocketComponent.Default.PostMessageAsync(10001,1)
    console.log(newData, '111111111111111');
}
</script>

<style scoped>
.perspective_wp {
    position: absolute;
    right: 0;
    top: 108px;
    width: 290px;
    height: 537px;
    background-image: url('/colImages/sjdh_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.line {
    width: 272px;
    height: 28px;
    position: absolute;
    right: 8px;
    top: 32px;
}

.tit {
    text-align: right;
    font-size: 22px;
    font-family: YouSheBiaoTiHei;
    font-weight: 400;
    color: #ffffff;
    padding-right: 38px;
    padding-top: 12px;
    margin-bottom: 26px;
}

.develop {
    position: absolute;
    left: 4px;
    top: 14px;
    width: 27px;
    height: 32px;
}

.ContentBox {
    overflow: hidden;
    width: 100%;
}

.viewBox {
    width: 50%;
    float: left;
    text-align: center;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #FFFFFF;

}

.viewBox_ico {
    width: 59px;
    height: 47px;
    margin-bottom: 12px;
    margin-top: 12px;
    font-size: 50px;
    color: rgba(159, 245, 255);
}

.StowedState {
    position: absolute;
    right: 0;
    top: 114px;
    width: 52px;
    height: 52px;
    background-image: url('/colImages/stowedState_r_bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.expArr {
    width: 27px;
    height: 32px;
    margin-top: 10px;
    margin-left: 13px;
}
</style>